Adaptive Memoization
نویسندگان
چکیده
We combine adaptivity and memoization to obtain an incremental computation technique that dramatically improves performance over adaptivity and memoization alone. The key contribution is adaptive memoization, which enables result re-use by matching any subset of the function arguments to a previous function call and updating the result to satisfy the unmatched arguments via adaptivity. We study the technique in the context of a purely functional language, called IFL, and as an ML library. The library provides an efficient implementation of our techniques with constant overhead. As examples, we consider Quicksort and Insertion Sort. We show that Quicksort handles insertions or deletions at random positions in the input list in O(log n) expected time. For insertion sort, we show that insertions and deletions anywhere in the list take O(n) time.
منابع مشابه
Abstract Adaptive Memoization ∗
Memoization may be viewed as a mechanism for re-using a computation—if a function is re-applied to the same argument we may re-use the previous computation to determine the result, rather than perform it again. Conventional memoization is accurate in the sense that it only permits re-use when a computation will be precisely the same as one that has already been performed. But in many cases a co...
متن کاملMultidimensional Predicates for Prolog
In 2014, Ungar et al. proposed Korz, a new computational model for structuring adaptive (objectoriented) systems [UOK14]. Korz combines implicit parameters and multiple dispatch to structure the behavior of objects in a multidimensional space. Korz is a simple yet expressive model which does not require special programming techniques such as the Visitor or Strategy pattern to accommodate a syst...
متن کاملUsing Automatic Memoization as a Software Engineering Tool in Real-World AI Systems
Memo functions and memoization are well-known concepts in A I programming. They have been discussed since the Sixties and are ofien used as ezamples in introductory programming texts. However, the automation of memoization as a practical sofiware engineering tool f o r A I systems has not received a detailed treatment. This paper describes how automatic memoization can be made viable on a large...
متن کاملMonadic Memoization Mixins
Memoization is a familiar technique for improving the performance of programs: computed answers are saved so that they can be reused later instead of being recomputed. In a pure functional language, memoization of a function is complicated by the need to manage the table of saved answers between calls to the function, including recursive calls within the function itself. A lazy recursive data s...
متن کاملUsing Automatic Memoization as a Software Engineering Tool in Real-world Ai Systems
Memo functions and memoization are well known concepts in AI programming. They have been around since the sixties and are often used as examples in introductory programming texts. However, the automation of memoization as a practical software engineering tool for AI systems has never received a detailed treatment. This paper describes how automatic memoization can be made viable on a large scal...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2003